package com.jxd.project.wzgl.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jxd.project.wzgl.dao.IApplicationGoodsDao;
import com.jxd.project.menu.model.ApplicationGoods;
import com.jxd.project.wzgl.service.IApplicationGoodsService;
import com.jxd.project.wzgl.vo.HistoryBRGoods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName ApplicationGoodsServiceImpl
 * @Description ApplicationGoods Service Implementation
 * @Author 刘成
 * @Date 2025/10/1 20:00
 * @Version 1.0
 */
@Service
public class ApplicationGoodsServiceImpl extends ServiceImpl<IApplicationGoodsDao, ApplicationGoods> implements IApplicationGoodsService {
    @Autowired
    private IApplicationGoodsDao applicationGoodsDao;

    @Override
    public boolean delWithApplicationId(int ApplicationId){
        return applicationGoodsDao.deleteByApplicationId(ApplicationId);
    }

    @Override
    public boolean delWithApplicationIds(List<Integer> applicationIds){
        return applicationGoodsDao.deleteByApplicationIds(applicationIds);
    }

    @Override
    public List<ApplicationGoods> getNotReturnGoods(int employeeId, int warehouseId){
        return applicationGoodsDao.selectNotReturnWithEmployeeId(employeeId,warehouseId);
    }

    @Override
    public List<ApplicationGoods> getWithApplicationId(int applicationId){
        return applicationGoodsDao.selectWithApplicationId(applicationId);
    }

    @Override
    public boolean returnGoods(List<Integer> applicationGoodsIds){
        return applicationGoodsDao.updateGoodsIsReturn(applicationGoodsIds);
    }

    @Override
    public boolean resetApplicationStatus(List<Integer> brIds){
        return applicationGoodsDao.updateApplicationStatus(brIds);
    }

    @Override
    public List<HistoryBRGoods> getHistoryBRGoods(Integer empNo){
        return applicationGoodsDao.selectHistoryWithEmpNo(empNo);
    }
}